<extend name="./public/frame.html"/>
<block name="content">
	<style type="text/css">
		blockquote {
			-webkit-margin-end: 0px;
		}
	</style>
	<blockquote class="layui-elem-quote search">
		<div class="layui-inline">
			<select id="money_statement" name="money_statement" class="layui-input" lay-filter="money_statement" style="width: 150px;">
				<option value="">流水类型</option>
				<?php foreach($money_statement_list as $key=>$value):?>
				<option value="<?php echo $key;?>"><?php echo $value;?></option>
				<?php endforeach;?>
			</select>
		</div>
		<div class="layui-inline">
			<input type="text" name="user_phone" id="user_phone" placeholder="手机号" class="layui-input">
		</div>
		<div class="layui-inline">
			<input type="text" name="order_sn" id="order_sn" placeholder="订单号" class="layui-input">
		</div>
		<!--<div class="layui-inline">-->
			<!--<select id="time_type" name="time_type" class="layui-input"lay-filter="time_type" style="width: 120px;">-->
				<!--<option value="1">生成时间</option>-->
				<!--<option value="2">注册时间</option>-->
			<!--</select>-->
		<!--</div>-->
		<div class="layui-inline">
			<input type="text" class="layui-input" id="start_time" autocomplete="off" placeholder="记录开始时间">
		</div>
		<div class="layui-inline">
			<input type="text" class="layui-input" id="end_time" autocomplete="off" placeholder="记录结束时间">
		</div>
		<!--<div class="layui-inline">-->
			<!--<select id="role_type" name="role_type" class="layui-input"lay-filter="role_type" style="width: 120px;">-->
				<!--<option value="">角色类型</option>-->
				<!--<option value="0">用户</option>-->
				<!--<option value="1">顺风车车主</option>-->
			<!--</select>-->
		<!--</div>-->
		<div class="layui-inline">
			<button class="layui-btn" data-type="search">搜索</button>
		</div>
	</blockquote>
	<table class="layui-table" lay-data="{width:'auto', height:'auto', url:'{:url('Finance/userFlowList')}', page: true, limit: 10, id:'userFlowList'}" lay-filter="userFlowList">
		<thead>
		<tr>
			<th lay-data="{field:'money_id', width:120,fixed: true, sort: true,align:'center',fixed: true}">流水ID</th>
			<th lay-data="{field:'uid', width:120,align:'center'}">用户ID</th>
			<th lay-data="{field:'user_phone', width:120,align:'center'}">用户手机号</th>
			<th lay-data="{field:'money_statement', width:150,align:'center'}">流水类型</th>
			<th lay-data="{field:'out_trade_no', width:200,align:'center'}">单号</th>
			<!--<th lay-data="{field:'register_time', width:160,align:'center'}">注册时间</th>-->
			<!--<th lay-data="{field:'role_type', width:150,align:'center'}">用户角色</th>-->
			<th lay-data="{field:'flow_money', width:150,align:'center'}">流水金额</th>
			<th lay-data="{field:'return_money', width:150,align:'center'}">不可提现金额</th>
			<th lay-data="{field:'money', width:150,align:'center'}">可提现金额</th>
			<th lay-data="{field:'gifts_money', width:150,align:'center'}">赠送金额</th>
			<!--<th lay-data="{field:'wallet_money', width:150,align:'center'}">当前余额</th>-->
			<th lay-data="{field:'time', width:198,align:'center'}">记录时间</th>
		</tr>
		</thead>
	</table>
	<script>
		// && d.activity_type !=2
		layui.use(['form','table','laydate'], function () {
			var table = layui.table,form = layui.form,laydate = layui.laydate;
			laydate.render({
				elem: '#start_time' //指定元素
			});

			laydate.render({
				elem: '#end_time' //指定元素
			});
			table.on('tool(userFlowList)', function (obj) {
				var data = obj.data;
				var id = data.id;
			});

			//搜索
			$('.layui-btn').on('click', function () {
                var money_statement	= $("#money_statement").val();
                var user_phone 		= $("#user_phone").val();
                var order_sn 		= $("#order_sn").val();
//				var time_type 		= $("#time_type").val();
				var start_time 		= $("#start_time").val();
				var end_time 		= $("#end_time").val();
//				var role_type		= $("#role_type").val();
				table.reload('userFlowList', {
					url: '/admin/Finance/userFlowList', where: {
                        "money_statement": money_statement,
                        "user_phone": user_phone,
						"order_sn": order_sn,
						"start_time": start_time,
						"end_time": end_time,
//						"role_type":role_type
					}
				});
			});
		});
	</script>
</block>
